import React from 'react'
import { withRouter } from 'react-router-dom'
import {NavBar,Icon} from 'antd-mobile'

export default withRouter( function MyNavbar(props) {

  const {history,mode,title,right,onClickLeft}=props

  return (
    <NavBar
      key='normal-navbar'
      mode={mode?mode:'light'}
      icon={<Icon type="left" color='#333'/>}
      onLeftClick={onClickLeft?onClickLeft:() => history.goBack()}
      rightContent={right?right:null}
    >
    {title}
    </NavBar>
  )
})
